<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="resources/css/style.css" type="text/css"/>

<script src="resources/js/jquery-1.9.1.js"></script>
<script type="text/javascript">
$(function() {
	$("input[name=dong]").focus();
});

function searchDong() {
	if($("input[name=dong]").val() == "") {
		alert("동/읍/면을 입력하세요.");
		return;
	}
	
	$.ajax({
		url: "searchDongList.ga",
		type: "post",
		dataType: "html",
		data: {
			dong: $("input[name=dong]").val()
		},
		success: function(data) {
			$("#result").html(data);
		},
		error: function() {
			alert("오류");
		}
	});
}
</script>

<title>꽁알 : Administrator</title>

</head>
<body>

<table width="100%">
	<tr>
		<td align="center"><b style="font-weight: bold;">동/읍/면 을 입력하세요.</b></td>
	</tr>
	<tr>
		<td align="center">
			<input type="text" name="dong" onkeydown="if(event.keyCode == 13) {searchDong();}"/>
			<input type="button" value="검색" onclick="searchDong()"/>
		</td>
	</tr>
</table>

<div id="result"></div>

</body>
</html>